$OpenBSD: patch-Modules_FindQt4_cmake,v 1.27 2016/11/28 09:15:13 dcoppa Exp $
--- Modules/FindQt4.cmake.orig	Fri Nov 11 15:37:13 2016
+++ Modules/FindQt4.cmake	Fri Nov 25 22:31:45 2016
@@ -514,7 +514,12 @@ endfunction()
 
 set(QT4_INSTALLED_VERSION_TOO_OLD FALSE)
 
-set(_QT4_QMAKE_NAMES qmake qmake4 qmake-qt4 qmake-mac)
+if (CMAKE_SYSTEM_NAME MATCHES "OpenBSD")
+  set(_QT4_QMAKE_NAMES qmake4)
+else()
+  set(_QT4_QMAKE_NAMES qmake4 qmake-qt4 qmake qmake-mac)
+endif()
+
 _qt4_find_qmake("${_QT4_QMAKE_NAMES}" QT_QMAKE_EXECUTABLE QTVERSION)
 
 if (QT_QMAKE_EXECUTABLE AND
@@ -694,6 +699,8 @@ if (QT_QMAKE_EXECUTABLE AND
 
   # Set QT_INCLUDES
   set( QT_INCLUDES ${QT_MKSPECS_DIR}/default ${QT_INCLUDE_DIR} ${QT_QTCORE_INCLUDE_DIR})
+  # Help QtOpenGL find GL/gl.h
+  list(APPEND QT_INCLUDES "${X11BASE}/include")
 
 
   # ask qmake for the documentation directory
@@ -1137,17 +1144,17 @@ if (QT_QMAKE_EXECUTABLE AND
     endif()
   endmacro()
 
-  _find_qt4_program(QT_MOC_EXECUTABLE Qt4::moc moc-qt4 moc4 moc)
-  _find_qt4_program(QT_UIC_EXECUTABLE Qt4::uic uic-qt4 uic4 uic)
+  _find_qt4_program(QT_MOC_EXECUTABLE Qt4::moc moc4 moc-qt4 moc)
+  _find_qt4_program(QT_UIC_EXECUTABLE Qt4::uic uic4 uic-qt4 uic)
   _find_qt4_program(QT_UIC3_EXECUTABLE Qt4::uic3 uic3)
   _find_qt4_program(QT_RCC_EXECUTABLE Qt4::rcc rcc)
   _find_qt4_program(QT_DBUSCPP2XML_EXECUTABLE Qt4::qdbuscpp2xml qdbuscpp2xml)
   _find_qt4_program(QT_DBUSXML2CPP_EXECUTABLE Qt4::qdbusxml2cpp qdbusxml2cpp)
-  _find_qt4_program(QT_LUPDATE_EXECUTABLE Qt4::lupdate lupdate-qt4 lupdate4 lupdate)
-  _find_qt4_program(QT_LRELEASE_EXECUTABLE Qt4::lrelease lrelease-qt4 lrelease4 lrelease)
+  _find_qt4_program(QT_LUPDATE_EXECUTABLE Qt4::lupdate lupdate4 lupdate-qt4 lupdate)
+  _find_qt4_program(QT_LRELEASE_EXECUTABLE Qt4::lrelease lrelease4 lrelease-qt4 lrelease)
   _find_qt4_program(QT_QCOLLECTIONGENERATOR_EXECUTABLE Qt4::qcollectiongenerator qcollectiongenerator-qt4 qcollectiongenerator)
-  _find_qt4_program(QT_DESIGNER_EXECUTABLE Qt4::designer designer-qt4 designer4 designer)
-  _find_qt4_program(QT_LINGUIST_EXECUTABLE Qt4::linguist linguist-qt4 linguist4 linguist)
+  _find_qt4_program(QT_DESIGNER_EXECUTABLE Qt4::designer designer4 designer-qt4 designer)
+  _find_qt4_program(QT_LINGUIST_EXECUTABLE Qt4::linguist linguist4 linguist-qt4 linguist)
 
   if (NOT TARGET Qt4::qmake)
     add_executable(Qt4::qmake IMPORTED)
